* MASTER DO FILE FOR THE PAPER: How Do Electoral Incentives Affect Legislator Behavior? *
* by Alex Fouirnaies and Andy Hall *


	*** prepare datasets for analysis
	project, do(code/legislators.do) // Creates a file with legislators based on Carl Klarner's data on electoral outcomes in the state legislatures
	project, do(code/AR_prep.do) // prepares data on outcomes in AR
	project, do(code/AZ_prep.do) // prepares data on outcomes in AZ
	project, do(code/CA_prep.do) // prepares data on outcomes in CA
	project, do(code/CO_prep.do) // prepares data on outcomes in CO
	project, do(code/FL_prep.do) // prepares data on outcomes in FL
	project, do(code/LA_prep.do) // prepares data on outcomes in LA
	project, do(code/ME_prep.do) // prepares data on outcomes in ME
	project, do(code/MI_prep.do) // prepares data on outcomes in MI
	project, do(code/MO_prep.do) // prepares data on outcomes in MO
	project, do(code/MT_prep.do) // prepares data on outcomes in MT
	project, do(code/NV_prep.do) // prepares data on outcomes in NV
	project, do(code/OH_prep.do) // prepares data on outcomes in OH
	project, do(code/OK_prep.do) // prepares data on outcomes in OK
	project, do(code/SD_prep.do) // prepares data on outcomes in SD
	project, do(code/TX_prep.do) // prepares data on outcomes in TX
	project, do(code/NY_prep.do) // prepares data on outcomes in NY
	project, do(code/append_state_files.do) // appends all the individual state files produced in the files above
	project, do(code/cmt_prep.do) // prepares the data on committee assignments
	project, do(code/bill_content.do) // prepares data on bill content based on regular expresions applied to the bill summaries
	project, do(code/idealpoints_prep.do) // load the data on WNOM estimates for each state
	project, do(code/ratings_prep.do) // prepare data on interest group ratings
	project, do(code/prof_prep.do) // prepare data on legislature professionalization
	project, do(code/merge.do) //merges all the files in to one main file
	project, do(code/matching.do) //produce dataset that matches treated legislators to legislators in non-termlimited states

	*Codebook
	project, do(code/codebook.do) //produce tex file with information for the code book
	

	*Descriptive info
	project, do(code/termlimits_take_effect.do) // Produces Table 1 showing when term limits take effect and the range of the data. 

	*Results: Productivity
	project, do(code/accountability_graph.do) // Produces Figure 1 showing the relationship between terms in office and legislator productivity index. 	
	project, do(code/table_productivity.do) // Produces Table 2 showing the effect on legislators' productivity	
	project, do(code/productivity_robust.do) //Produces Table 3 showing robustness to alternative specifications	
	project, do(code/productivity_components_table.do) // Produces Table 4 showing the effects on the three input components of the productivity index
	
	*Results: Ideological positions	
	project, do(code/voting_table.do) // Produces Table 5 with W-Nominate results	
	project, do(code/ratings_figure.do) // Produces Figure 2 with the effects on interest group ratings	
	
	*Appendix
	project, do(code/legislators_table.do) // Produces appendix Table A.1 reporting the number of legislators/term limited legislators by state and term	
	project, do(code/selection_figure.do) // Produces appendix figures Figure A.1 and Figure A.2 with selection effects  
	project, do(code/selection_table.do) // Produces appendix Table A.2 with selection effects  
	project, do(code/termlimittypes_table.do) // Produces appendix Table A.3 that shows how main effect varies across state legislative institutions
	project, do(code/interest_group_rating_summary.do) // Produces appendix Table A.4 with overview of interest group ratings 
	project, do(code/state_rankings.do) // Produces appendix figures A.3 and A.4 that show how the term limited states + NY/TX compare to the other states wrt professionalization and legislative salaries


